package edu.ccut.saturn.studio.logic.model.drop.saturndata;

import org.eclipse.core.resources.IProject;
import org.eclipse.jdt.internal.core.JarEntryFile;
import org.eclipse.swt.widgets.Display;
import org.w3c.dom.Document;

import edu.ccut.saturn.studio.core.exception.XMLException;
import edu.ccut.saturn.studio.core.util.xml.SaturnW3CUtil;
import edu.ccut.saturn.studio.dialog.dropsaturndata.SaturnsqlDataDialog;
import edu.ccut.saturn.studio.logic.model.Shape;
import edu.ccut.saturn.studio.logic.model.drop.AbstarctDropHandler;

public class SaturnsqlDataDropHandler extends AbstarctDropHandler {
	public Shape getShape(String filePath, IProject project) {
		Document databasedocument = null;
		try {
			databasedocument = SaturnW3CUtil.getDocument(filePath);
		} catch (XMLException e) {
			e.printStackTrace();
		}
		SaturnsqlDataDialog saturnDataDialog = new SaturnsqlDataDialog(Display
				.getDefault().getShells()[0],databasedocument);
		saturnDataDialog.open();
		return saturnDataDialog.getSaturnComponentNode();
	}

	public Shape getShape(JarEntryFile jarEntryFile) {
		return null;
	}

}
